package com.mingqijia.gassafety.job.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mingqijia.gassafety.db.entity.RecordController;
import com.mingqijia.gassafety.db.entity.RecordDetector;
import com.mingqijia.gassafety.db.entity.RecordDtu;
import com.mingqijia.gassafety.db.entity.RecordReceiverValve;

import java.util.List;

/**
 * <p>
 * 控制器上报数据 服务类
 * </p>
 *
 * @author guoliang.lao
 * @since 2022-08-03
 */
public interface RecordControllerService extends IService<RecordController> {

    /**
     * 分页查询大于时间段内的数据
     * @param page
     * @param pageSize
     * @param endTime
     * @return
     */
    List<RecordController> getListByTime(int page, int pageSize, String startTime, String endTime, int isHistory);

    /**
     * 分页查询所有的数据
     * @param page
     * @param pageSize
     * @param endTime
     * @return
     */
    List<RecordController> getPageList(int page, int pageSize);


    /**
     * 批量把列表数据迁移到历史表中
     * @param recordController
     * @param detectorList
     * @param receiverList
     * @param dtuList
     * @param page
     */
    void deviceRecordHandle(RecordController recordController, List<RecordDetector> detectorList,
                            List<RecordReceiverValve> receiverList, List<RecordDtu> dtuList,int page);

    /**
     * 删除已备份过的数据
     * @param delIds
     * @param detectorList
     * @param receiverList
     * @param dtuList
     * @param page
     */
    void deleteRecord(List<Long> delIds, List<RecordDetector> detectorList,
                            List<RecordReceiverValve> receiverList, List<RecordDtu> dtuList,int page);

    /**
     * 删除上一年的历史数据
     */
    void deleteRecordHistory(String month);
}
